class WordBook {
  final String id;
  final String name;
  final String coverImage;
  final int totalWords;
  final String description;
  final String category;
  final String data; // 词书数据目录路径

  WordBook({
    required this.id,
    required this.name,
    required this.coverImage,
    required this.totalWords,
    required this.description,
    required this.category,
    required this.data,
  });

  factory WordBook.fromJson(Map<String, dynamic> json) {
    return WordBook(
      id: json['id'],
      name: json['name'],
      coverImage: json['cover_image'],
      totalWords: json['total_words'],
      description: json['description'],
      category: json['category'],
      data: json['data'],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'id': id,
      'name': name,
      'cover_image': coverImage,
      'total_words': totalWords,
      'description': description,
      'category': category,
      'data': data,
    };
  }
} 